﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace tu_xls_001
{
    class Program
    {
        static void Main(string[] args)
        {
            Excel.Application xlsApp = new Excel.ApplicationClass();
            Excel.Workbook xlsWorkbook;
            Excel.Worksheet xlsWorkSheet;
            object misValue = System.Reflection.Missing.Value;
            string xls_path = "c:\\paid_unpaid_sample.xls";
            xlsWorkbook = xlsApp.Workbooks.Add(misValue);  // create a new workbook
            xlsWorkSheet = (Excel.Worksheet)xlsWorkbook.Worksheets.get_Item(1);  // get the first work sheet

            xlsWorkbook.SaveAs(xls_path, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue,misValue,misValue );
            xlsWorkbook.Close(true, xls_path, misValue);
            xlsApp.Quit();
        }
    }
}
